package com.king.java.tools.http.client.okhttp;



import com.king.java.tools.http.HttpUtils;
import com.king.java.tools.http.client.okhttp.impl.GetHttp;
import com.king.java.tools.http.client.okhttp.impl.PostHttp;
import com.king.java.tools.http.entity.ConnectEntity;
import com.king.java.tools.http.entity.HttpJsonEntity;
import com.king.java.tools.http.entity.HttpMethod;

/**
 * 描述:
 *
 * @author : sujinchen
 * @date : 2020/10/15
 */
class OkhttpServiceImplTest {
    public static void main(String[] args) throws InterruptedException {
        HttpJsonEntity post = new HttpJsonEntity("http://swqa.gz.cvte.cn/mock/kavabotdevice/v1/api/localization/save");
        post.addHead("key1", "value");
        post.addHead("key2", "value");
        post.setReqBody("{\n" +
                "   \"list\": [\n" +
                "      {\n" +
                "         \"id\": 1,\n" +
                "         \"name\": \"hello\",\n" +
                "         \"enableRecord\": true,\n" +
                "         \"recordResolution\": 1080,\n" +
                "         \"enablePush\": true,\n" +
                "         \"pushResolution\": 1080,\n" +
                "         \"pushUrl\": \"rtmp://192.168.102.170:6935/demo/425\",\n" +
                "         \"cycStorage\": 3\n" +
                "      },\n" +
                "      {\n" +
                "         \"id\": 3,\n" +
                "         \"name\": \"world\",\n" +
                "         \"enableRecord\": true,\n" +
                "         \"recordResolution\": 1080,\n" +
                "         \"pushUrl\": \"rtmp://192.168.102.170:6935/demo/424\",\n" +
                "         \"cycStorage\": 3\n" +
                "      }\n" +
                "   ]\n" +
                "}");

        try {
            ConnectEntity run = new GetHttp(post).run();
            System.out.println(run);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

}